<header role="banner">
  <div class="container logo-wrap">
    <div class="row pt-5">
      <div class="col-12 text-center">
        <a class="absolute-toggle d-block d-md-none" data-toggle="collapse" href="#navbarMenu" role="button" aria-expanded="false" aria-controls="navbarMenu"><span class="burger-lines"></span></a>
        <h1 class="site-logo"><a href="<%= Routes.page_path(@conn, :index) %>"><%= @site_params.title %></a></h1>
      </div>
    </div>
  </div>
  
  <nav class="navbar navbar-expand-md  navbar-light bg-light">
    <div class="container">
      
      
      <div class="collapse navbar-collapse" id="navbarMenu">
        <ul class="navbar-nav mx-auto">
          <%= for item <- @site_params[:menu][:main] do %>
            <%=  if length(item[:children] || []) == 0 do %>
              <li class="nav-item">
                <a class="nav-link active" href="<%= item.url %>"><%= item.label %></a>
              </li>
            <% else %>
              <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="<%= item.url %>"  data-toggle="dropdown" aria-haspopup="true"><%= item.label %></a>
                <div class="dropdown-menu" >

                  <%= for sub_item <- item.children do %>
                    <a class="dropdown-item" href="<%= sub_item.url %>"><%= sub_item.label %></a>
                  <% end %>
                </div>

              </li>
            <% end %>
          <% end %>
          
        </ul>
        
      </div>
    </div>
  </nav>
</header>
